package com.zsy.oauth2.config.dto;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName CustomUser
 * @Description TODO
 * @Author zhaoshouyun
 * @Date 2020/4/20 20:40
 * @Version 1.0
 */
public class CustomUser extends User {

    private String id;    //用户ID
    private String name;  //用户名字
    private Map<String,Object> otherUserInfoParam = new HashMap<>();//扩展其他字段

    public CustomUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map<String, Object> getOtherUserInfoParam() {
        return otherUserInfoParam;
    }

    public void setOtherUserInfoParam(Map<String, Object> otherUserInfoParam) {
        this.otherUserInfoParam = otherUserInfoParam;
    }
}
